﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="releaseDetail.aspx.vb" Inherits="gojira.releaseDetail" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" GridLines="None" 
        style="float:left; margin-right: 114px;">
        <Columns>
            <asp:TemplateField HeaderText="Details of this release:" HeaderStyle-HorizontalAlign="Left">
            <ItemTemplate>
                <h1><%# Eval("FilmName") %></h1>
                <p>Format: <%# Eval("Format")%></p>
                <p>Region: <%# Eval("Region")%></p>
                <p>Original Japanese audio? <%# Eval("JapaneseAudio")%></p>
                <p>English subtitles? <%# Eval("EnglishSubtitles")%></p>
                <p>Distributor: <%# Eval("Distributor")%></p>
                <p>Uploaded by: <%# Eval("Uploader")%></p>
                 <a href='filmDetail.aspx?ID=<%# Eval("FilmID") %>'>More information about this film</a>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
        <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" GridLines="None" style="float:left">
        <Columns>
            <asp:TemplateField>
            <ItemTemplate>
                <p><asp:Image ID="Image1" runat="server" Height="200px" Width="150px" ImageUrl='<%# Eval("FrontCover") %>' /></p>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        SelectCommand="SELECT * FROM [godzillaFilmsQuery] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <div style="float:right">
    Average user&#39;s rating for this release:<br />
    <br />
    <asp:Rating
        width="200" 
        Height="40" 
        ID="rating_average" 
        runat="server" 
        StarCssClass="ratingStar" 
        WaitingStarCssClass="savedRatingStar" 
        EmptyStarCssClass="emptyRatingStar" 
        filledStarCssClass="filledRatingStar"
        MaxRating="5" ReadOnly="True" 
    >
    </asp:Rating>
    <br />
    <asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ID" DataSourceID="SqlDataSource3" GridLines="None" 
        ShowHeader="False">
        <Columns>
            <asp:TemplateField>
            <ItemTemplate>
            <a href='ReleaseReview.aspx?ID=<%# Eval("ID") %>'>Rate this release</a>
            <br />
            <a href='ReleaseComment.aspx?ID=<%# Eval("ID") %>'>Comment on this release</a>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        SelectCommand="SELECT [ID] FROM [releases] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource2" Width="328px" DataKeyNames="ID">
        <Columns>
            <asp:TemplateField HeaderText="Comments">
            <ItemTemplate>
            <div>
                <h1>User: <%# Eval("Author")%></h1>
                <h2>Subject: <%# Eval("Subject")%></h2>
                <p><%# Eval("Comment") %></p>
            </div>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        SelectCommand="SELECT * FROM [releaseComments] WHERE ([releaseID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="releaseID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
        <br />
    </div>
    </asp:Content>
